#include <iostream>
using namespace std;
int main()
{
    __int64 f[51],i;
    int n;
    f[0]=0;f[1]=1;
    for (i=2;i<=50;i++)f[i]=f[i-1]+f[i-2];
    while (cin>>n)
    {
        if (n==-1)break;
        cout<<f[n]<<endl;
    }
    return 0;
}